<template>
  <lay-out
    :show-header-color="true"
    :page-tag="{
       type:'005',
       number:'123456'
    }"
    :title="{text:'123456',reg:'QQ账号'}">
    <!-- QQ好友实名 -->
    <label-list :data="friendsData"></label-list>
    <!-- QQ邮箱实名 -->
    <label-list :data="mailData"></label-list>
    <!-- QQ群实名 -->
    <label-list :data="groupData"></label-list>
    <!-- 落地 -->
    <portrait-list :data="portraitData"></portrait-list>
    <!-- 涉及案件 -->
    <involved-in-case :data="caseData" title="涉案"></involved-in-case>
    <!-- 好友 -->
    <friends-block title="好友" :detlFriendData="detlFriendList" :friendTypeData="friendTypeData"></friends-block>
    <!-- 我创建的群 -->
    <create-group-block title="Q群" :createData="gCreateList"></create-group-block>
    <!-- 我加入的群 -->
    <join-group-block :joinData="gJoinList"></join-group-block>
    <!-- 好友通联 -->
    <friends-logs-list title="通联内容" :converseList="fConverList"></friends-logs-list>
    <!-- Q群通联 -->
    <group-logs-list :converseList="gConverList"></group-logs-list>
  </lay-out>
</template>

<script>
  import LayOut from '../../components/lay-out'
  import LabelList from '../../components/label-list'
  import PortraitList from '../../components/portrait-list'
  import InvolvedInCase from '../../components/involved-in-case'
  import FriendsLogsList from './friends-logs-list'
  import FriendsBlock from './friends-block'
  import CreateGroupBlock from './create-group-block'
  import JoinGroupBlock from './join-group-block'
  import GroupLogsList from './group-logs-list'
  import request from '../../helper/request'
  import * as dataInit from './qqDataInit'
  export default {
    name: 'index',
    components: {
      LayOut,
      LabelList,
      PortraitList,
      InvolvedInCase,
      FriendsLogsList,
      FriendsBlock,
      CreateGroupBlock,
      JoinGroupBlock,
      GroupLogsList
    },
    mixins: [],
    computed: {},
    data() {
      return {
        friendsData: {
          title: 'QQ好友实名',
          num: '12',
          icon: '/static/icon/two.png',
          list: []
        },
        mailData: {
          title: 'QQ邮箱实名',
          num: '12',
          // icon: '/static/icon/qq-mail.png',
          icon: '/static/icon/two.png',
          list: []
        },
        groupData: {
          title: 'QQ群实名',
          num: '12',
          // icon: '/static/icon/qq-qun.png',
          icon: '/static/icon/two.png',
          list: []
        },
        portraitData: {
          title: '落地',
          num: '12',
          // icon: '/static/icon/luodi.png',
          icon: '/static/icon/two.png',
          list: []
        },
        caseData: {
          title: '涉及案件',
          num: '',
          icon: '/static/icon/case.png',
          list: []
        },
        detlFriendList: [], // 好友详情列表数据
        friendTypeData: {},
        gCreateList: [], // 创建群列表
        gJoinList: [], // 加入群列表
        fConverList: [], // 好友通联列表
        gConverList: [] // Q群通联列表
      }
    },
    methods: {
      zhysApiFetch(serCode, param) { // zhys API 数据获取
        request('superRecord/qq/zhys', serCode, param).then((res) => {
          this.friendsData.list = dataInit.hysmDataInit(res)
          this.mailData.list = dataInit.yxsmDataInit(res)
          this.groupData.list = dataInit.qsmDataInit(res)
          this.portraitData.list = dataInit.znldDataInit(res)
        })
      },
      sjjqajApiFetch(serCode, param) {
        request('superRecord/qq/sjjqaj', serCode, param).then((res) => {
          this.caseData.list = dataInit.sjjqajDataInit(res)
        })
      },
      hyApiFetch(serCode, param) {
        request('superRecord/qq/hy', serCode, param).then((res) => {
          this.detlFriendList = dataInit.hyDataInit(res).type_0.slice(0, 3)
          this.friendTypeData = dataInit.hyTypeDataInit(res)
        })
      },
      qqunApiFetch(serCode, param) { // QQ群
        request('superRecord/qq/qqun', serCode, param).then((res) => {
          this.gCreateList = dataInit.qUniteCreateInit(res).slice(0, 3)
          this.gJoinList = dataInit.qUniteJoinInit(res).slice(0, 3)
        })
      },
      hytlApiFetch(serCode, param) { // 好友通联
        request('superRecord/qq/hytl', serCode, param).then((res) => {
          this.fConverList = dataInit.hytlDataInit(res).slice(0, 3)
        })
      },
      qqtlApiFetch(serCode, param) { // q群通联
        request('superRecord/qq/qqtl', serCode, param).then((res) => {
          this.gConverList = dataInit.qqtlDataInit(res).slice(0, 3)
        })
      }
    },
    watch: {},
    mounted() {
    },
    created() {
      this.zhysApiFetch('SC0427', {'bsh': '120656432'})
      this.sjjqajApiFetch('SC0428', {'bsh': '120656432'})
      this.hyApiFetch('SC0429', {
        'bsh': '120656432',
        'type': '00',
        'pageObj': {
          'currPage': 1,
          'pageSize': 10,
          'pagination': '1'
        }
      })
      this.qqunApiFetch('SC0430', {'bsh': '120656432'})
      this.hytlApiFetch('SC043101', {
        'bsh': '120656432',
        'pageObj': {
          'currPage': 1,
          'pageSize': 10,
          'pagination': '1'
        }
      })
      this.qqtlApiFetch('SC043102', {
        'pageObj': {
          'currPage': 1,
          'pageSize': 10,
          'pagination': '1'
        }
      })
    }
  }
</script>
